Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #544: Correctly pass StopIteration trough wrappers #545

Conversation

RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Oct 31, 2024

Raising a StopIteration in a generator triggers a RuntimeError.
If the RuntimeError of a generator has the passed in StopIteration as cause
resume with that StopIteration as normal exception instead of failing with the RuntimeError.

closes #544

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

changelog/544.bugfix.rst Outdated Show resolved Hide resolved
testing/test_multicall.py Outdated Show resolved Hide resolved
src/pluggy/_callers.py Show resolved Hide resolved
@RonnyPfannschmidt RonnyPfannschmidt marked this pull request as draft October 31, 2024 14:17
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the ronny/fix-544-wrapper-stop-iteration-passtrough branch from ed5b22b to 44455ea Compare November 3, 2024 04:58
@RonnyPfannschmidt RonnyPfannschmidt marked this pull request as ready for review November 3, 2024 04:58
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the ronny/fix-544-wrapper-stop-iteration-passtrough branch from 44455ea to eb49a73 Compare November 3, 2024 05:00
Raising a StopIteration in a generator triggers a RuntimeError.
If the RuntimeError of a generator has the passed in StopIteration as cause
resume with that StopIteration as normal exception instead of failing with the RuntimeError.
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the ronny/fix-544-wrapper-stop-iteration-passtrough branch from eb49a73 to 9cf2eaa Compare November 3, 2024 14:40
@RonnyPfannschmidt RonnyPfannschmidt merged commit 9d19d4b into pytest-dev:main Nov 12, 2024
15 of 18 checks passed
@RonnyPfannschmidt RonnyPfannschmidt deleted the ronny/fix-544-wrapper-stop-iteration-passtrough branch November 12, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StopIteration passtrough not handled correctly
2 participants